home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.42 / includes3v1 / includes3v1.lha / Exec / Ports.i < prev    next >
Text File  |  1994-12-04  |  2KB  |  82 lines

  1.  
  2. {
  3.     Ports.i for PCQ Pascal
  4.  
  5.     This file defines ports and messages, which are used for inter-
  6.     task communications using the routines defined toward the
  7.     bottom of this file.
  8. }
  9.  
  10. {$I "Include:Exec/Nodes.i"}
  11. {$I "Include:Exec/Lists.i"}
  12.  
  13. type
  14.  
  15.     PortType = (PASignal, PASoftInt, PAIgnore, PFAction);
  16.  
  17. {****** MsgPort *****************************************************}
  18.  
  19.     MsgPort = record
  20.     mp_Node        : Node;
  21.     mp_Flags    : PortType;
  22.     mp_SigBit    : Byte;        { signal bit number    }
  23.     mp_SigTask    : Address;    { task to be signalled (TaskPtr) }
  24.     mp_MsgList    : List;        { message linked list  }
  25.     end;
  26.     MsgPortPtr = ^MsgPort;
  27.  
  28. {****** Message *****************************************************}
  29.  
  30.     Message = record
  31.     mn_Node        : Node; 
  32.     mn_ReplyPort    : MsgPortPtr;    { message reply port }
  33.     mn_Length    : Short;    { message len in bytes }
  34.     end;
  35.     MessagePtr = ^Message;
  36.  
  37.  
  38. { mp_Flags: Port arrival actions (PutMsg) }
  39.  
  40. CONST
  41.  
  42.   PF_ACTION    = 3;    { * Mask * }
  43.   PA_SIGNAL    = 0;    { * Signal task in mp_SigTask * }
  44.   PA_SOFTINT    = 1;    { * Signal SoftInt in mp_SoftInt/mp_SigTask * }
  45.   PA_IGNORE    = 2;    { * Ignore arrival * }
  46.  
  47.  
  48.  
  49. Procedure AddPort(port : MsgPortPtr);
  50.     External;
  51.  
  52. Function FindPort(name : String): MsgPortPtr;
  53.     External;
  54.  
  55. Function GetMsg(port : MsgPortPtr): MessagePtr;
  56.     External;
  57.  
  58. Procedure PutMsg(port : MsgPortPtr; mess : MessagePtr);
  59.     External;
  60.  
  61. Procedure RemPort(port : MsgPortPtr);
  62.     External;
  63.  
  64. Procedure ReplyMsg(mess : MessagePtr);
  65.     External;
  66.  
  67. Function WaitPort(port : MsgPortPtr): MessagePtr;
  68.     External;
  69.  
  70.  
  71. { -- 2.0 fcts. -- }
  72.  
  73. Function CreateMsgPort(): MsgPortPtr;
  74.     External;
  75.  
  76.  
  77. Procedure DeleteMsgPort( mp : MsgPortPtr );
  78.     External;
  79.  
  80.  
  81.  
  82.